﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace Polar.AI.Common
{
    public static class BodyExtension
    {
        public static float Direction(this IBody body)
        {
            if (body.LinearVelocity.IsZero())
                return 0;
            else
                return body.LinearVelocity.ToRadians();
        }

        public static Vector2 Forward(this IBody body)
        {
            if (body.LinearVelocity.IsZero())
                return Vector2.Zero;
            else
                return Vector2.Normalize(body.LinearVelocity);
        }
    }
}
